<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let ss = [
        {
          to: [100, 10, 20, 30, 40, 50],
          from: [
            10497, 23174, 28203, 29325, 33489, 37000, 29034, 31000, 63023,
            84832,
          ],
        },
        {
          to: [200, 10, 20, 30, 40, 50],
          from: [
            10497, 23174, 28203, 29325, 33489, 37000, 29034, 31000, 63023,
            84832,
          ],
        },
      ];
      let fromArr = [];
      for (let i = 0; i < ss.length; i++) {
        let fromObj = ss[i].to;
        for (let j = 0; j < fromObj.length; j++) {
          let fromArrObj = fromArr[j];
          if (fromArrObj == "" || fromArrObj == undefined) {
            fromArrObj = [];
          }
          fromArrObj.push(fromObj[j]);
          fromArr[j] = fromArrObj;
        }
        console.log(fromArr);
        // fromArr[i] = fromArrObj;
      }
      let fromArr1 = [];
      fromArr.forEach((item) => {
        let num = 0;
        item.forEach((v) => {
          num = v + num;
        });
        fromArr1.push(num);
      });
      console.log(fromArr1);
    </script>
  </body>
</html>
